﻿
@{
    ViewBag.Title = "ShroffBook";
}
<style>
    .clear{
        clear:both;
    }
    .tabletitle{
        text-align:center;
        color:black;
        padding-top:10px;
    }
    .tablek{
        background-color:white;
        font-family:'黑体';
    }
    .tb{
        width:90%;
        margin:auto;
        margin-top:5px;
        margin-bottom:10px;
        font-size:16px;
    }
    span{
        color:black;
    }
    .tablenumber{
        width:90%;
        margin:auto;
        margin-top:20px;
        font-size:17px;
    }
    .tb div{
        margin:5px 5px 5px 5px;
    }
    .tb1{
        width:100%;
    }
    .tb input{
        width:98%;
        margin:auto;
        display:block;
        border:0;
        outline:none;
    }
    .tb textarea{
        width:98%;
        height:150px;
        margin:auto;
        display:block;
        margin-top:10px;
        margin-bottom:10px;
        resize:vertical;
    }
    input[type=checkbox],input[type=radio]{
        display:inline-block;
        width:30px;
    }
    .tb .form-control{
        width:40%;
        margin-left:40px;
    }
    .tb1 .form-control{
        width:100%;
        margin-left:0;
    }
    .shi input{
        width:50px;
        display:inline-block;
        border-bottom:1px solid;
        text-align:center;
    }
    .tb .yjs{
        width:50%;
        display:inline-block;
    }
    .tb .dx{
        margin-left:10px;
        margin-right:10px;
        width:80px;
        display:inline-block;
        text-align:center;
    }
    .tb .rsp{
        float:right;
    }
    .tb .di{
        width:200px;
        display:inline-block;
        border-bottom:1px solid;
    }
    label{
        font-weight:500;
        cursor:pointer;
    }
    .qian{
        text-align:right;
    }
    .qian span{
        text-align:left;
        float:left;
    }
    .qian .di{
        width:150px;
        text-align:center;
        position:relative;
        right:20px;
        bottom:-120px;
    }
    .shrbtn{
        width:90%;
        margin:auto;
        display:block;
        margin-top:20px;
        margin-bottom:20px;
        font-size:18px;
    }
    .modal-content{
        margin-top:40%;
        border-radius:0;
    }
    #insurer,#insurer1{
        display:none;
    }
    .btns{
        position:fixed;
        top:50%;
        right:5%;
    }
    .btns *{
        display:block;
        margin:20px;
    }
    #top{
        display:none;
    }
    #cardtips{
        position:absolute;
        color:red;
        display:none;
    }
</style>
<script src="~/Scripts/modal.js"></script>
@*<script>
    $(function () {
        var inpu = $('input');
        var tear = $('textarea');
        for (var i = 0; i < inpu.length; i++) {
            $(inpu[i]).removeAttr('required');
        }
        for (var i = 0; i < tear.length; i++) {
            $(tear[i]).removeAttr('required');
        }
    });
</script>*@
<div class="btns">
    <button id="top" class="btn btn-default">快速置顶</button>
    <button id="bottom" class="btn btn-default">快速置底</button>
</div>
<form action="/Home/AddShroffBook" method="post">
    <div class="tablek">
        <h3 class="tabletitle">司法鉴定委托书</h3>
        <div class="tablenumber">表格编号：<span>@ViewBag.number</span></div>
        <input type="hidden" name="shroff_number" value="@ViewBag.number" />
        <table class="tb" border="1">
            <tr>
                <td width="80"><div>委托人</div></td>
                <td><input required name="client" /></td>
                <td width="80"><div>联系人</div></td>
                <td><input required name="contact_user" /></td>
            </tr>
            <tr>
                <td><div>联系地址</div></td>
                <td><input required name="contact_readdress" /></td>
                <td><div>联系电话</div></td>
                <td><input required name="contact_phone" /></td>
            </tr>
            <tr>
                <td><div>委托日期</div></td>
                <td><input required name="consignation_date" /></td>
                <td><div>送检人</div></td>
                <td><input required name="submit_check_user" /></td>
            </tr>
            <tr>
                <td><div>与鉴定有关的基本案情</div></td>
                <td colspan="3">
                    <div style="margin:10px 10px 10px 10px;">
                        被鉴定人情况：
                        <table class="tb1" border="1">
                            <tr>
                                <td width="80"><div>姓名</div></td>
                                <td><input required name="username" /></td>
                                <td width="80"><div>性别</div></td>
                                <td>
                                    <select required name="sex" class="form-control">
                                        <option value="">请选择性别</option>
                                        <option value="男">男</option>
                                        <option value="女">女</option>
                                    </select>
                                </td>
                                <td width="80"><div>族别</div></td>
                                <td>
                                    <select required name="nationality" class="form-control">
                                        <option value="">请选择族别</option>
                                        @{ 
                                            foreach (var item in ViewBag.na)
                                            {
                                                <option value="@item.id">@item.nationalityName</option>
                                            }
                                        }
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td><div>出生年月</div></td>
                                <td><input required name="date_of_birth" /></td>
                                <td><div>文化程度</div></td>
                                <td><input required name="culture_degree" /></td>
                                <td><div>职业</div></td>
                                <td><input required name="profession" /></td>
                            </tr>
                            <tr>
                                <td><div>身份证号</div></td>
                                <td colspan="5">
                                    <input required id="card" name="ID_card" placeholder="请先填写身份证号码，以便系统匹配数据。" />
                                    <div id="cardtips"><span class='glyphicon glyphicon-remove-circle'></span><span style="position:relative;top:-1px;padding-right:5px;"> 身份证号输入错误</span></div>
                                </td>
                            </tr>
                            <tr>
                                <td><div>现住址</div></td>
                                <td colspan="5"><input required name="present_readdress" /></td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td><div>委托鉴定事项</div></td>
                <td colspan="3"><textarea required name="consignation_transaction"></textarea></td>
            </tr>
            <tr>
                <td><div>是否属于重新鉴定</div></td>
                <td colspan="3">
                    <div>
                        <label><input name="is_re_shroff" value="是" type="radio" /><span>是</span></label>
                        <label><input name="is_re_shroff" value="否" type="radio" /><span>否</span></label>
                        <label><input name="is_re_shroff" value="其他" type="radio" /><span>其他</span></label>
                    </div>
                </td>
            </tr>
            <tr>
                <td><div>鉴定材料</div></td>
                <td colspan="3"><textarea required name="shroff_material"></textarea> </td>
            </tr>
            <tr>
                <td><div>鉴定用途</div></td>
                <td colspan="3">
                    <div>
                        <label><input required name="shroff_purpose" value="涉保理赔" type="radio" /><span>涉保理赔</span></label>
                        <label><input required name="shroff_purpose" value="非涉保理赔" type="radio" /><span>非涉保理赔</span></label>
                        <label><input required name="shroff_purpose" value="其他" type="radio" /><span>其他</span></label>
                    </div>
                </td>
            </tr>
            <tr id="insurer">
                <td><div>涉保理赔保险公司</div></td>
                <td colspan="3">
                    <select disabled required name="insurer" class="form-control">
                        <option>请选择保险公司</option>
                        @{ 
                            foreach (var item in ViewBag.ins)
                            {
                                <option value="@item.insurer_id">@item.insurerName</option>
                            }
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td><div>鉴定时限</div></td>
                <td colspan="3">
                    <div class="shi">一般在<input required name="shroff_time_limit" />个工作日内；2.遇到特殊情况知会双方延期至<input required name="shroff_time_limit_1" />个工作日。</div>
                </td>
            </tr>
            <tr>
                <td rowspan="2"><div>鉴定费用及收取方式</div></td>
                <td colspan="3"><input required name="get_shroff_money_type" /></td>
            </tr>
            <tr>
                <td colspan="3"><div><span>预计收费总计：<input required name="shroff_money" class="yjs" /></span><span class="rsp">人民币大写<input required name="shroff_money_majuscular" class="dx" />元整</span></div></td>
            </tr>
            <tr>
                <td><div>鉴定文书发送方式</div></td>
                <td colspan="3">
                    <div>
                        <label><input required name="document_methods" value="自取" type="radio" /><span>自取一般采取此方式</span></label><br />
                        <label><input required name="document_methods" value="" id="youji1" type="radio" /><span>邮寄&nbsp;</span>地址:<input id="youji" class="di" /></label><br />
                        <label><input required name="document_methods" value="" id="qita1" type="radio" /><span>其他方式(说明)<input id="qita" class="di" /></span></label>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <div>
                        约定事项：<br />
                        <div>1.鉴定机构应当严格遵照有关技术规范保管和使用鉴定材料。鉴定委托人同意或者认可：</div>
                        <label><input name="use_shroff_material" value="1" type="checkbox" />因鉴定需要耗尽鉴定材料；</label><br />
                        <label><input name="use_shroff_material" value="2" type="checkbox" />因鉴定需要可能损坏鉴定材料；</label><br />
                        <label><input name="use_shroff_material" value="3" type="checkbox" />鉴定完成后无法完整退还鉴定材料；</label><br />
                        <label><input name="use_shroff_material" value="4" type="checkbox" />检材留样保存三个月；</label>
                        <div class="shi">2.鉴定时限：从该委托书生效之日起<input required name="shroff_time" /> 个工作日</div>
                        <div>注：鉴定过程中补充或重新提取鉴定材料所需的时间，不计入鉴定时限。</div>
                        <div>3.特殊情形鉴定：</div>
                        <label><input value="1" name="special_situation" type="checkbox" />需要对女性做妇科检查；</label><br />
                        <label><input value="2" name="special_situation" type="checkbox" />需要对未成年人的身体检查；</label><br />
                        <label><input value="3" name="special_situation" type="checkbox" />需要对被鉴定人进行法医精神病鉴定；</label><br />
                        <label><input value="4" name="special_situation" type="checkbox" />需要到现场提取材料；</label><br />
                        <label><input value="5" name="special_situation" type="checkbox" />需要进行尸体解剖；</label>
                        <div>4.委托人要求鉴定人回避，被要求回避的鉴定人签名：<input required name="shroff_user_qian" class="di" /></div>
                        <div>5.鉴定过程中需要变更委托书内容，由双方协商确定。</div>
                        <div>6.其他约定事项。</div>
                    </div>
                </td>
            </tr>
            <tr>
                <td><div>其他说明事项</div></td>
                <td colspan="3">
                    <textarea required name="other_transaction"></textarea>
                </td>
            </tr>
            <tr>
                <td><div>鉴定风险提示</div></td>
                <td colspan="3">
                    <div>
                        1.委托人应向鉴定机构提供真实、完整、充分的鉴定材料，并对其真实性、合法性负责。<br />
                        2.鉴定意见属于专家专业性意见，其是否被 采信取决于办案机关的审查和判断，鉴定人和鉴定机构无权干涉。<br />
                        3.由于鉴定材料和客观条件限制，并非所有的鉴定都能得出明确的鉴定意见。<br />
                        4.鉴定活动遵循依法独立、客观、公正的原则，因此，鉴定意见可能对一方有利，另一方不利。
                    </div>
                </td>
            </tr>
            <tr class="qian">
                <td colspan="2">
                    <div style="height:150px;">
                        <span>委托人(机构)<br />(签名或者盖章)</span>
                        <input required name="clientorinstitution_qian" class="di" />
                    </div>
                </td>
                <td colspan="2">
                    <div style="height:150px;">
                        <span>接收委托的鉴定机构<br />(签名或者盖章)</span>
                        <input required name="shroff_institution_qian" class="di" />
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="4"><div>监督管理管理电话：绵阳市司法局&nbsp;0816-2264821</div></td>
            </tr>
            <tr>
                <td><div>备注</div></td>
                <td colspan="3">
                    <textarea required name="remarks"></textarea>
                </td>
            </tr>
            <tr id="insurer1">
                <td><div>通知保险公司</div></td>
                <td colspan="3">
                    <div>
                        <label>时间：<input disabled required name="inform_insurer" class="di" /></label><br />
                        <label>通知人：<input disabled required name="inform_insurer_1" class="di" /></label><br />
                        <label>联系电话：<input disabled required name="inform_insurer_2" class="di" /></label>
                    </div>
                </td>
            </tr>
        </table>
        <button type="submit" disabled class="btn btn-primary shrbtn">确&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;定</button>
        <div style="height:10px;"></div>
    </div>
</form>
<div id="msg">@Html.ValidationMessage("BookError")</div>
<script>
    $(function () {
        $(window).scroll(function () {
            if ($(window).scrollTop() > 100) {
                $("#top").show();
            }
            else {
                $("#top").hide();
            }
            if ($(window).scrollTop()+1000 > $(document).height()) {
                $("#bottom").hide();
            } else {
                $('#bottom').show();
            }
        });

        tpwei();

        window.onresize = function () {
            tpwei();
        }

        var msg = $('#msg>span').html();
        if (msg != "") {
            $.alert("错误提示",msg);
        }

        var radio = $('input:radio[name="shroff_purpose"]');
        radio.click(function () {
            var a = $(this).val();
            if (a == "涉保理赔") {
                $('#insurer select,#insurer1 input').removeAttr('disabled');
                $('#insurer,#insurer1').show();
            } else {
                $('#insurer,#insurer1').hide();
                $('#insurer select,#insurer1 input').attr('disabled', 'disabled');
            }
        });

        $('#youji').change(function () {
            $('#youji1').val("地址："+$(this).val());
        });

        $('#qita').change(function () {
            $('#qita1').val("说明："+$(this).val());
        });

        $('#top').click(function () {
            $('body,html').animate({ scrollTop: 0 }, 500);
        });

        $('#bottom').click(function () {
            $('body,html').animate({ scrollTop: $(document).height() }, 500);
        });

        $('#card').keyup(function () {
            getbe(this);
        });

        $('#card').change(function () {
            getbe(this);
        });

    });

    function getbe(wo) {
        var lenght = $(wo).val().length;
        console.log(lenght);
        if (lenght != 18) {
            $('#cardtips').html("<span class='glyphicon glyphicon-remove-circle' style='color:red;'></span><span style='position:relative;top:-1px;padding-right:5px;color:red;'> 身份证号输入错误</span>");
            $('#cardtips').css({ 'color': 'red' });
            $('#cardtips').fadeIn(500);
            $('button[type="submit"]').attr('disabled','disabled');
        } else {
            $.post('/Home/getbe', { 'card': $(wo).val() }, function (o) {
                $("input[name='username']").val(o['username']);
                $("select[name='sex']").val(o['sex']);
                $("select[name='nationality']").val(o['nationality']);
                $("input[name='date_of_birth']").val(o['date_of_birth']);
                $("input[name='culture_degree']").val(o['culture_degree']);
                $("input[name='profession']").val(o['profession']);
                $("input[name='ID_card']").val(o['ID_card']);
                $("input[name='present_readdress']").val(o['present_readdress']);
            });
            $('#cardtips').css({ 'color': '#3CC825' });
            $('#cardtips').html("<span class='glyphicon glyphicon-ok-circle' style='color:#3CC825;'></span><span style='position:relative;top:-1px;padding-right:5px;color:#3CC825;'> 身份证号输入正确</span>");
            $('#cardtips').fadeIn(500);
            $('button[type="submit"]').removeAttr('disabled');
        }
    }

    function tpwei() {
        var letp = $('#card').offset();
        var crwidth = $('#card').width();
        var crheight = $('#card').height();
        var tiwidth =  $('#cardtips').width();
        var tiheight = $('#cardtips').height();
        $('#cardtips').css({ "top": letp.top + ((crheight - tiheight) / 2)-3, "left": letp.left + crwidth - tiwidth });
    }
</script>